<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="de.laures.cewolf.ChartPostProcessor"%>
<%@page import="java.awt.*" %>
<%@page import="java.util.*"%>
<%@page import="de.laures.cewolf.*"%>
<%@page import="de.laures.cewolf.cpp.*"%>
<%@page import="de.laures.cewolf.example.*"%>
<%@page import="de.laures.cewolf.links.*"%>
<%@page import="de.laures.cewolf.taglib.CewolfChartFactory" %>
<%@page import="de.laures.cewolf.tooltips.*"%>
<%@page import="org.jfree.chart.*"%>
<%@page import="org.jfree.chart.event.ChartProgressEvent" %>
<%@page import="org.jfree.chart.event.ChartProgressListener" %>
<%@page import="org.jfree.chart.plot.*"%>
<%@page import="org.jfree.data.*"%>
<%@page import="org.jfree.data.category.*"%>
<%@page import="org.jfree.data.gantt.*"%>
<%@page import="org.jfree.data.general.*"%>
<%@page import="org.jfree.data.time.*"%>
<%@page import="org.jfree.data.xy.*"%>
<%@taglib uri="http://cewolf.sourceforge.net/taglib/cewolf.tld" prefix="cewolf" %>
<jsp:useBean id="pieEnhancer" class="de.laures.cewolf.cpp.PieEnhancer" />
<%
DatasetProducer pieData = new DatasetProducer() {
    public Object produceDataset(Map params) {
      final String[] categories = { "apples", "pies", "bananas", "oranges" };
      DefaultPieDataset ds = new DefaultPieDataset();
      for (int i = 0; i < categories.length; i++) {
        int y = (int) (Math.random() * 10 + 1);
        ds.setValue(categories[i], new Integer(y));
      }
      return ds;
    }
    public String getProducerId() {
      return "PieDataProducer";
    }
    public boolean hasExpired(Map params, Date since) {
      return false;
    }
  };
  pageContext.setAttribute("pieData", pieData);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<dvi>
<cewolf:chart id="pieChart" title="Pie" type="pie">
    <cewolf:data>
        <cewolf:producer id="pieData" />
    </cewolf:data>
    <cewolf:chartpostprocessor id="pieEnhancer">
    </cewolf:chartpostprocessor>
</cewolf:chart>
<cewolf:img chartid="pieChart" renderer="/cewolf" width="800" height="400"/>
</dvi>
<div>
<cewolf:chart id="pie3d" title="Pie3D" type="pie3D" >
    <cewolf:data>
        <cewolf:producer id="pieData" />
    </cewolf:data>
</cewolf:chart>
<cewolf:img chartid="pie3d" renderer="/cewolf" width="800" height="400"   >
</cewolf:img>
</div>
</body>
</html>